cmake_minimum_required(VERSION 3.2)

project(USA006 VERSION 1.0.10.210430)

# set directory
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.)
set(CMAKE_CXX_STANDARD 11)
set(GLOBAL_VERSION ${PROJECT_VERSION})

IF (WIN32)
    add_definitions(
        -D_WIN32_WINNT=0x0601
        -DUNICODE -D_UNICODE
        -DWIN32 -D_WIN32
    )
ELSE()
    add_definitions(
        -DUNIX -D_UNIX
    )
ENDIF ()

# set output directory
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
message(STATUS "executable output path: " ${EXECUTABLE_OUTPUT_PATH})
message(STATUS "library output path: " ${LIBRARY_OUTPUT_PATH})

# subprojects
message(STATUS)
message(STATUS "building zhilaiSDK...")
add_subdirectory(zhilaiSDK)

message(STATUS)
message(STATUS "building zhilaiSDK_tool...")
add_subdirectory(zhilaiSDK_tool)

if (MSVC)
    set(LIB_ZLBASE ${SRC_DIR}/common/zlbase_v2.0.7_msvc2015)
endif ()

include_directories(
    ${LIB_ZLBASE}/include
    rapidjson-1.1.0/include
)

link_directories(
    ${LIB_ZLBASE}/lib
)

add_subdirectory(zhilaiSDK_demo)